﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Portal.Workflow.StartPluginTemplate;
using Portal.Cms.Model;
using Portal.Sharepoint.Utility;

namespace Portal.Cms.Cpv.Render.PlugIn
{
    public class NewsStartWorkflowPlugIn:WorkflowStartPluginTemplate
    {
        public override string ServiceId
        {
            get
            {
                return "NewsStartWorkflowPlugIn";
            }
        }

        public override string ServiceName
        {
            get
            {
                return "Khởi tạo quy trình đưa dữ liệu lên sharepoint";
            }
        }

        public override void Execute(
            System.Data.IDbTransaction Trans, 
            string SiteId, 
            string ObjectType, 
            string ObjectId, 
            object odata,
            string CommandAction)
        {
            CmsDataCls OCmsData = (CmsDataCls)odata;
            SPPublishingService.StartWorkflow(SiteId, OCmsData);
        }
    }
}
